/**
 * 商品方法显示
 */

import React, { useRef } from 'react'
import { Popup } from '@/components/Popup'
import { View, Image } from '@tarojs/components'

import './index.scss'
import { ButtonEle, ButtonType } from '../../../../../components/Buttton'


export interface INoticeProps {
    vis: boolean
    title: string
    content: string
    onClose: () => void
}
export const NoticeModal: React.FC<INoticeProps> = (
    prop
) => {

    return (
        <Popup
            visible={prop.vis}
            position="center"
            round
            onClose={prop.onClose}
            closeOnClickOverlay
            customStyle={{
                borderBottomLeftRadius: 0,
                borderBottomRightRadius: 0
            }}
        >
            <View className="xxm-notice-view-ele">
                <View className='xxm-notice-view'>
                    <View className='xxm-notice-title'>{prop?.title}</View>
                    <View className='xxm-notice-content'>{prop?.content}</View>
                </View>
                <View className="xxm-notice-view-ele__footer">
                    <ButtonEle
                        type={ButtonType.DANGE}
                        block
                        square
                        onClick={() => {
                            console.log('xxxx')
                            prop.onClose()
                        }}
                    >关闭</ButtonEle>
                </View>
            </View>
        </Popup>
    )
}